# Whether Notification manager is running at the kubesphere.
kubesphere: true

hook:
  postInstall:
    image:
      repo: {{ ks_kubectl_repo }}
      tag: {{ ks_kubectl_tag }}
      pullPolicy: IfNotPresent
    backoffLimit: 3

# notification-manager-operator
operator:
  containers:
    proxy:
      image:
        repo: {{ notification_manager_operator_proxy_repo }}
        tag: {{ notification_manager_operator_proxy_tag }}
        pullPolicy: IfNotPresent
      resources:
        limits:
          cpu: {{ monitoring.notification_manager.proxy.resources.limits.cpu | default("50m") }}
          memory: {{ monitoring.notification_manager.proxy.resources.limits.memory | default("50Mi") }}
        requests:
          cpu: {{ monitoring.notification_manager.proxy.resources.requests.cpu | default("5m") }}
          memory: {{ monitoring.notification_manager.proxy.resources.requests.memory | default("10Mi") }}
    operator:
      image:
        repo: {{ notification_manager_operator_repo }}
        tag: {{ notification_manager_operator_tag }}
        pullPolicy: IfNotPresent
      resources:
        limits:
          cpu: {{ monitoring.notification_manager.operator.resources.limits.cpu | default("50m") }}
          memory: {{ monitoring.notification_manager.operator.resources.limits.memory | default("50Mi") }}
        requests:
          cpu: {{ monitoring.notification_manager.operator.resources.requests.cpu | default("5m") }}
          memory: {{ monitoring.notification_manager.operator.resources.requests.memory | default("20Mi") }}
{% if monitoring.nodeSelector is defined and monitoring.nodeSelector is not none %}
  nodeSelector:
    {{ monitoring.nodeSelector | to_nice_yaml(indent=2) | indent(4) }}
{% elif nodeSelector is defined and nodeSelector is not none %}
  nodeSelector:
    {{ nodeSelector | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  nodeSelector: {}
{% endif %}
{% if monitoring.tolerations is defined and monitoring.tolerations is not none %}
  tolerations:
    {{ monitoring.tolerations | to_nice_yaml(indent=2) | indent(4) }}
{% elif tolerations is defined and tolerations is not none %}
  tolerations:
    {{ tolerations | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  tolerations: []
{% endif %}
{% if monitoring.affinity is defined and monitoring.affinity is not none %}
  affinity:
    {{  monitoring.affinity | to_nice_yaml(indent=2) | indent(4) }}
{% elif affinity is defined and affinity is not none %}
  affinity:
    {{ affinity | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  affinity: {}
{% endif %}


# value of notification-manager
notificationmanager:
  name: notification-manager
  image:
    repo: {{ notification_manager_repo }}
    tag: {{ notification_manager_tag }}
    pullPolicy: IfNotPresent
{% if nodeNum is defined and nodeNum < 3 %}
  replicas: 1
{% else %}
  replicas: 2
{% endif %}
  resources:
    limits:
      cpu: {{ monitoring.notification_manager.resources.limits.cpu | default("500m") }}
      memory: {{ monitoring.notification_manager.resources.limits.memory | default("500Mi") }}
    requests:
      cpu: {{ monitoring.notification_manager.resources.requests.cpu | default("5m") }}
      memory: {{ monitoring.notification_manager.resources.requests.memory | default("20Mi") }}
{% if monitoring.nodeSelector is defined and monitoring.nodeSelector is not none %}
  nodeSelector:
    {{ monitoring.nodeSelector | to_nice_yaml(indent=2) | indent(4) }}
{% elif nodeSelector is defined and nodeSelector is not none %}
  nodeSelector:
    {{ nodeSelector | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  nodeSelector: {}
{% endif %}
{% if monitoring.tolerations is defined and monitoring.tolerations is not none %}
  tolerations:
    {{ monitoring.tolerations | to_nice_yaml(indent=2) | indent(4) }}
{% elif tolerations is defined and tolerations is not none %}
  tolerations:
    {{ tolerations | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  tolerations: []
{% endif %}
{% if monitoring.affinity is defined and monitoring.affinity is not none %}
  affinity:
    {{  monitoring.affinity | to_nice_yaml(indent=2) | indent(4) }}
{% elif affinity is defined and affinity is not none %}
  affinity:
    {{ affinity | to_nice_yaml(indent=2) | indent(4) }}
{% else %}
  affinity: {}
{% endif %}
  defaultConfigSelector:
    matchLabels:
      type: default
  receivers:
    tenantKey: user
    globalReceiverSelector:
      matchLabels:
        type: global
    tenantReceiverSelector:
      matchLabels:
        type: tenant
    options:
      email:
        notificationTimeout: 5
        deliveryType: bulk
      slack:
        notificationTimeout: 5
      wechat:
        notificationTimeout: 5
  volumeMounts:
    - mountPath: /etc/localtime
      name: host-time
      readOnly: true
  volumes:
    - hostPath:
        path: /etc/localtime
        type: ""
      name: host-time
  volumeMounts: []
  volumes: []
  defaultSecretNamespace: kubesphere-monitoring-federated
  groupLabels:
      - alertname
      - namespace
  template:
    language: English
    languagePack:
      - name: zh-cn
        namespace: kubesphere-monitoring-system
    text:
      name: notification-manager-template
      namespace: kubesphere-monitoring-system
  env:
    - name: TZ
      value: Asia/Shanghai
  sidecars:
     tenant:
       image:
         repo: {{ notification_tenant_sidecar_repo }}
         tag: {{ notification_tenant_sidecar_tag }}